#include <iostream>
#include <queue>
#include <string.h>
using namespace std;



struct edge{
	int stop,next;
	double len;
	bool operator < (const edge a)const{
		return len<a.len;
	}
};



int main(){
	int n,m;
	cin>>n>>m;
	int eh[n];
	edge e[2*m];
	double dis[n];
	for(int i=0;i<n;i++){
		dis[i] = -1;
	}
	memset(eh,-1,sizeof(eh));
	for(int i=0;i<m;i++){
		int s,t;
		double l;
		scanf("%d%d",&s,&t);
		cin>>l;
		l = 1-l/100;
		s--;
		t--;
		e[2*i].stop = t;
		e[2*i].len = l;
		e[2*i].next = eh[s];
		eh[s] = 2*i;
		
		e[2*i+1].stop = s;
		e[2*i+1].len = l;
		e[2*i+1].next = eh[t];
		eh[t] = 2*i+1;
	}
	
	int a,b;
	cin>>a>>b;
	a--;
	b--;
	
	dis[a] = 1;
	priority_queue<edge> q;
	int index;
	index = eh[a];
	while(index != -1){
		q.push(e[index]);
		index = e[index].next;
	}
	
	
	for(int i=1;i<n;i++){
		if(dis[b] != -1)
			break;
		edge l;
		do{
			l = q.top();
			q.pop();
		}while(dis[l.stop] != -1);
		
		dis[l.stop] = l.len;
		
		index = eh[l.stop];
		while(index != -1){
			if(dis[e[index].stop] == -1)
				q.push({e[index].stop,0,e[index].len*dis[l.stop]});
			index = e[index].next;
		}
	}
	
//	for(int i=0;i<n;i++)
//		cout<<dis[i]<<" ";
//	cout<<endl;
	
	printf("%.8f",100/dis[b]);
	return 0;
}
